package com.example.demo.converter;

import com.example.demo.dto.UserDto;
import com.example.demo.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface UserConverter {
    public static final UserConverter C = Mappers.getMapper(UserConverter.class);

    @Mapping(source = "username", target = "name")
    public UserDto toDto(User user);
}
